package com.atguigu.democustomer.service.impl;

import com.atguigu.democustomer.bean.Customer;
import com.atguigu.democustomer.mapper.CustomerMapper;
import com.atguigu.democustomer.service.CustomerService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DS("mysql")
public class CustomerSerivceImpl extends ServiceImpl<CustomerMapper,Customer> implements CustomerService {
//
//    @Autowired
//    CustomerMapper customerMapper;

    @Override
    public Customer getCustomerByid(String id) {
        return this.baseMapper.selectById(id);

//        return customerMapper.getCustomer(id);
    }

    @Override
    public void saveCustomer(Customer customer) {
        System.out.println("保存 customer:"+customer);
        this.baseMapper.insert(customer);
    }
}
